home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWString / Include / SLStrRun.xh < prev    next >
Encoding:
Text File  |  1996-08-16  |  4.3 KB  |  187 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLStrRun.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *     File:        SLStrRun.idl
  14.  * 
  15.  *     Contains:    Interface for OTextRunReader and OTextRunWriter classes
  16.  * 
  17.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  18.  * 
  19.  * 
  20.  */
  21.  
  22.  
  23. #ifndef SOM_FW_OStringRunWriter_xh
  24. #define SOM_FW_OStringRunWriter_xh
  25.  
  26. class FW_OStringRunWriter;
  27.  
  28. #define FW_OStringRunWriter_MajorVersion 1
  29. #define FW_OStringRunWriter_MinorVersion 0
  30.  
  31. /*
  32.  * Passthru lines: File: "C.xh", "before"
  33.  */
  34. struct FW_SPrivStringRep;
  35.  
  36. /* C++ SOM defs */
  37. #include <somcls.xh>
  38. #include <somcm.xh>
  39.  
  40. /* C++ parent defs */
  41. #ifndef SOM_FW_OTextRunWriter_xh
  42. #include <SLTxtRun.xh>
  43. #endif
  44.  
  45. #ifndef FW_OStringRunWriter_API
  46. #define FW_OStringRunWriter_API
  47. /*
  48.  * -- The Class API
  49.  */
  50.  
  51. /*
  52.  * Start of user-defined types:
  53.  */
  54. class SOMClass;
  55. class SOMObject;
  56. class FW_OTextRunReader;
  57. class FW_OTextRunWriter;
  58. class FW_OMemoryRunReader;
  59. class FW_OMemoryRunWriter;
  60. class FW_OStringRunWriter;
  61.  
  62. /*
  63.  * End of user-defined types.
  64.  */
  65.  
  66. #ifdef OLDIBMSOMAPISUPPORT
  67. #define FW_OStringRunWriterCClassData FW_OStringRunWriterClassData
  68. #define FW_OStringRunWriterNewClass(major,minor) somNewVersionedClassReference(FW_OStringRunWriter,major,minor)
  69. #endif
  70.  
  71. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  72. #define FW_OStringRunWriterMetaClass SOMClass
  73.  
  74. #if PRAGMA_ALIGN_SUPPORTED
  75. #  pragma options align=power
  76. #endif
  77.  
  78. /* The API to the FW_OStringRunWriter class object, and the methods it introduces. */
  79. SOMEXTERN struct FW_OStringRunWriterClassDataStructure {
  80. #ifdef OLDIBMSOMAPISUPPORT
  81.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  82. #else
  83.     long zero;
  84. #endif
  85.     somStaticClassInfo *sci;
  86.     somDToken        instanceDataToken;
  87.     long reserved [3];
  88.     somMToken somInit;
  89.     somMToken somUninit;
  90.     somMToken GetCurrentRun;
  91.     somMToken FlushRun;
  92.     somMToken NewRun;
  93.     somMToken Initialize;
  94. } SOMDLINK FW_OStringRunWriterClassData;
  95.  
  96. #if PRAGMA_ALIGN_SUPPORTED
  97. #  pragma options align=reset
  98. #endif
  99.  
  100. #if !defined(FW_OStringRunWriter_Class_Source) && !defined(SOM_Module_slstrrun_Source)
  101. #if PRAGMA_IMPORT_SUPPORTED
  102. #pragma import list FW_OStringRunWriterClassData
  103. #endif
  104. #endif
  105.  
  106.  
  107. /*
  108.  * -- Typedefs and inline method declarations for left path inherited methods
  109.  * -- are omitted because this compilation had -museinheritedmethods in effect
  110.  */
  111.  
  112.  
  113. /*
  114.  * -- Typedefs for FW_OStringRunWriter Method Procedures
  115.  */
  116. SOMEXTERN {
  117. typedef FW_OStringRunWriter*   (* SOMLINK somTD_FW_OStringRunWriter_Initialize)(FW_OStringRunWriter *somSelf, Environment *ev,
  118.         FW_SPrivStringRep* theString,
  119.         short bufferSize);
  120. }
  121.  
  122. #endif /* FW_OStringRunWriter_API */
  123.  
  124.  
  125. /*
  126.  * -- This emitter treats Method Tokens as Thunks by default.
  127.  * -- Use the sc modifier "nothunks" to change this default
  128.  */
  129. #undef somresolve_
  130. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  131.  
  132. /*
  133.  * -- The C++ Wrapper Class for FW_OStringRunWriter
  134.  */
  135. class FW_OStringRunWriter : public FW_OTextRunWriter
  136. {
  137. public:
  138.  
  139. // FW_OStringRunWriter::new registers use of the class object, and then uses somNew
  140. // to allocate memory and load the object method table pointer. 
  141. void *operator new(size_t size)
  142. {
  143.     SOM_IgnoreWarning(size);
  144.     // Allocate memory using the default allocator for FW_OStringRunWriter, and
  145.     // clear mem & set method table pointer, call basic initialization
  146. #ifdef SOMCHKNULL
  147.     void * __somResult = (void *)
  148.       somNewObject(FW_OStringRunWriter);
  149.     SOMCHKNULL(__somResult);
  150.     return __somResult;
  151. #else
  152.     return (void*) somNewObject(FW_OStringRunWriter);
  153. #endif
  154. }
  155.  
  156. // FW_OStringRunWriter::delete uses the default deallocator for the object's class.
  157. void operator delete(void * obj)
  158. {
  159.     if (obj) {
  160.         SOM_Resolve(obj,SOMObject,somFree)
  161.            ( (SOMObject*) obj );
  162.     }
  163. }
  164.  
  165. /* method: Initialize */
  166. FW_OStringRunWriter*   Initialize(Environment *ev,
  167.         FW_SPrivStringRep* theString,
  168.         short bufferSize)
  169. {
  170.    #ifdef SOMCHKEXCEPT
  171.    FW_OStringRunWriter* __somResult = 
  172.       SOM_ResolveD(this,FW_OStringRunWriter,FW_OStringRunWriter,Initialize)
  173.     (this,ev,theString,bufferSize);
  174.       SOMCHKEXCEPT;
  175.    return __somResult;
  176. #else
  177.    return SOM_ResolveD(this,FW_OStringRunWriter,FW_OStringRunWriter,Initialize)
  178.     (this,ev,theString,bufferSize);
  179. #endif
  180. }
  181.  
  182. };   /* FW_OStringRunWriter */
  183.  
  184.  
  185.  
  186. #endif       /* SOM_FW_OStringRunWriter_xh */
  187.